@(qcms: List[Qcm]) 
@import helper._ 


@main("Qcm List") {
<h2> <p class="text-info"> Titre a rajouter : @qcms.size() qcm(s) </p></h2>

        
        <table class="table table-condensed">
            <thead>
            	<tr>
            		<th></th>
                    <th><h5>Libelle</h5></th>
                    <th><h5>Createur</h5></th>
                    <th><h5>Statut</h5></th>
                </tr>
            </thead>
            <tbody>

			@for(qcm <- qcms) {
				@if(qcm.getStatut() == "Clos"){			
				<tr>
					<td width = 20>
						<div class="accordion-group">
							<div class="accordion-heading">
								<a href="#collapse@qcm.getIdQcm()"   data-parent="#accordion@qcm.getIdQcm()"  data-toggle="collapse" class="accordion-toggle">
								<i class="icon-search" size="small"/></i>
								</a> 
							</div>
						</div>
					</td> 
					
					<td><a href=@routes.PasserQCM.debutQCM(qcm.getIdQcm())> <p class="text-info"> @qcm.getLibelle() </p></a></td>
					<td>@qcm.getExpert().getUser().getNom()</td>
					<td>
					<font color="red">  @qcm.getStatut() </font>
					</td>
				</tr>
				<tr> 
					<td colspan="5"> 
						<div class="accordion-body collapse" id="collapse@qcm.getIdQcm()" style="height: 0px;"> 
						 	<div class="accordion-inner" >
							
							<div class="controls controls-row">
							<div class="span4" >
						 	Creation : @qcm.getDateCreation().format("dd/MM/yyyy HH:mm")<br>
						 	Ouverture : @qcm.getDateOuverture().format("dd/MM/yyyy HH:mm")<br>
						 	Fermeture : @qcm.getDateCloture().format("dd/MM/yyyy HH:mm")<br>
						 	</div>
						 	<div class="span4" >
							Nombre de questions : @qcm.getListeQuestions().size()<br>
						 	Duree Approx : @(qcm.getListeQuestions().size()*3) min<br>
						 	</div>
						 	<div class="span3" >
						 	
						 	@if(qcm.getStatut() == "Ouvert"){
						 		@if(Etudiant_Qcm.findbyIds(qcm.getIdQcm(),Long.parseLong(session.get("id"))) == null){
						 		<div class="input-append">
  									<input class="span2" id="appendedInputButton" type="text" value="saisir la cle"> 
  									<button class="btn btn-primary" type="button" href="">Go </button>
								</div>
								}else{
									<div class="input-append">
  									<input class="span2" id="appendedInputButton" type="text" value="QCM deja realise" disabled="disabled"> 
  									<button class="btn btn-primary" type="button" disabled="disabled" >Go </button>
								</div>
								}
							}
							@if(qcm.getStatut() == "A venir"){
							}
							
						 	</div>
						 	</div>
						 	
							 </div>
						</div>
					</td>
				</tr>
		
		}
	
	}
	</tbody>
        </table>
        
   <a class="btn btn-primary" href="@routes.Application.index()">Menu principal <i class="icon-white icon-circle-arrow-right"></i></a>
        
}
